package jjn.kamacoder.case14;

import java.util.Scanner;

/**
 * @author Jiang Jining
 * @since 2023-08-30 22:49
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            sc.nextLine();
            for (int i = 0; i < n; i++) {
                StringBuilder sb = new StringBuilder();
                String s = sc.nextLine();
                String[] parts = s.split(" +");
                for (String part : parts) {
                    sb.append(Character.toUpperCase(part.charAt(0)));
                }
                System.out.println(sb);
            }
        }
    }
}
